package com.feri.shop.controller;

import com.feri.shop.dto.OrderPayDto;
import com.feri.shop.service.intf.PayService;
import com.feri.shop.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@RequestMapping("/api/pay/")
@Api(value = "实现支付相关操作",tags = "实现支付相关操作")
public class PayController {
    @Autowired
    private PayService service;

    @PostMapping("savepay.do")
    public R save(@RequestBody OrderPayDto dto){
        return service.createPay(dto);
    }
    @GetMapping("closepay.do")
    public R close(String no){
        return service.closePay(no);
    }
    @GetMapping("querypay.do")
    public R query(String no){
        return service.queryPay(no);
    }
    @GetMapping("all.do")
    public R all(){
        return service.queryAll();
    }
}
